package com.sgb.kjwl.view.widget;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;

import androidx.annotation.RequiresApi;
import androidx.appcompat.widget.AppCompatButton;

import com.sgb.kjwl.R;

public class FollowButton extends AppCompatButton implements View.OnClickListener {


    @RequiresApi(api = Build.VERSION_CODES.M)
    public FollowButton(Context context) {
        super(context);
        initView(context);
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    public FollowButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    public FollowButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    public void initView(Context context){
        this.setGravity(TEXT_ALIGNMENT_CENTER);
        this.setText("关注");
        this.setBackgroundResource(R.drawable.bgw_lb);
        this.setTextColor(context.getColor(R.color.new_blue));

        this.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

    }
}
